package control;

import user.Menu;
import user.SystemMenu;

import java.util.Scanner;



public class GoodsFunction {
    Scanner input;
    public void runFunction(){
        Scanner scanner=new Scanner(System.in);
        try {
            Goods goods;
            String goodsId = "";//运行时输入
            do {
                Menu.administrator();
                String userChoice = scanner.next();
                switch (userChoice) {
                    case "1":
                        UserManagement();
                        break;
                    case "2":
                        GoodsManagement();

                        break;
                    case "3":
                        OrderManagement();
                        break;
                    case "4":
                        Statistics();
                        break;
                    case "5":
                        exit();
                        break;
                }
                System.out.println("按任意键继续..."); System.in.read();
            } while (true);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("系统出错了，请重试");
        }

    }
    public void UserManagement(){

    }//用户管理
    public static void GoodsManagement(){
        System.out.println("\t\t商品管理功能");
        System.out.println("----------------");
        System.out.println("1、添加商品信息");//Ctrl+d复制一行
        System.out.println("2、删除商品信息");
        System.out.println("3、修改商品信息");
        System.out.println("4、查询商品信息");
        System.out.println("5、退出系统");
        System.out.println("----------------");//Alt+Shift+向下方向键
        System.out.print("请选择(1|2|3|4|5):");
    }//商品管理
    public void OrderManagement(){

    }//订单管理
    public void  Statistics(){

    }//统计
    public void  exit() {
        System.out.print("是否真的要退出系统？（Y|N）:");
        String userInput = input.next();
        if (userInput.equalsIgnoreCase("y")) {
            System.exit(0);
        }
    }

}
